/**
 * Created by tu_pei on 2018/3/24.
 */
/**
 * Created by tu_pei on 2018/3/24.
 */
$(function(){
//        $('.right_bespeak_btn_card').on('click',function(){
//            $('.addBespeak').removeClass('hidden');
//        });
//        关闭弹窗

    $('.edit_ok').on('click',function(){
        var _upDatas={
            cardName:$('input[name=cardName]').val(),
            cardType:$('input[name=cardType]').val(),
            cardTotalTime:$('select[name=cardTotalTime]').val(),
            cardCost:$('select[name=cardCost]').val(),
            discountCost:$('select[name=discountCost]').val(),
            targetCost:$('select[name=targetCost]').val(),
            discountCosts:$('select[name=discountCosts]').val(),
            serviceId:$('select[name=serviceId]').val(),
            validDay:$('select[name=validDay]').val(),
            cardState:$('select[name=cardState]').val(),
            discountDesc:$('select[name=discountDesc]').val(),
            subclinicIds:$('select[name=subclinicIds]').val()
        }
        if(DocData.imgChange){
            _upDatas.cardImg=$('img.imghead').attr('src')
        }
        $.post(baseUrl.base+baseUrl.card+'add',_upDatas,function(res){
            if(res.code == '0'){
                baseFn.infoDialog('成功添加！')
            }
        },'json')
    })

});

//图片上传{}
function zcuploadImageCover(e){
    baseFn.imgUpload($(e).parents('form').attr('id'),function(res){
        $(e).siblings('.Js_preview').find('img').attr('src',res.url)
    })
}